<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <title>Document</title>
</head>
<body>
<div>
    [{"title":"特惠区","cinemaSeatsId":
</div>
<a href="https://openapi.alipaydev.com/gateway.do?app_id=9021000151645808&biz_content=%7B%22subject%22%3A%22%5Cu5f71%5Cu7968%5Cu968f%5Cu8d2d+1%22%2C%22out_trade_no%22%3A1%2C%22total_amount%22%3A10%2C%22product_code%22%3A%22FAST_INSTANT_TRADE_PAY%22%7D&charset=utf-8&method=alipay.trade.page.pay&return_url=https%3A%2F%2Fbaidu.com&sign_type=RSA2&timestamp=2025-08-28+21%3A21%3A44&version=1.0&sign=M6ecdfX60xl614s5lnYExQKTB5%2FCHr49HmEsqonmcLB%2B2yT428od%2FuvXGkgkPYrhMRYV2rwueCxQ0aCoNOgyzErwH5tIZTbwleGkSykgzsNPNmDMaV8saOb7GFgYF62hHMdaadDUzf65h0quT0wf9AIinQrkY%2Fs5EEqO%2BvJDGGEv0LBn%2B%2FwwoOCwOFQg958HjhF1R7dvXuhdEq1HrhpU5SFRcpt1XJmJAZ61C702sQzlYHwbkhcqnbQ18Srj2Plw8pJl%2F5bqEvnedEX3Mtl0ito%2FsJTsUdc5Pe1UefTRxJFpR%2Fj947PArNEcqLsahbjwJwSaNcBtJo9h%2BPFG8qCxTw%3D%3D"
   target="_blank">点击这里去支付</a>

<button onclick="handlerFn()"> 点击去支付</button>
</body>
<script src="index.js"></script>
<script>
    // 假设后端返回 { data: "https://openapi...&timestamp=..." }
    handlerFn = () => {
        fetch('http://127.0.0.1:8000/fsdy/ciname/pay/2/').then(r => r.json()).then(res => {
            console.log(res)
            window.location.href = res.data;  // 直接赋值，不要插到 innerHTML
        });
    }
</script>
</html>
